package cn.kpi.service.vtiondpline.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import cn.kpi.dao.vtiondpline.VtDpItemDao;
import cn.kpi.entity.vtiondpline.VtDpItemEntity;
import cn.kpi.service.vtiondpline.IVtDpItemService;

@Service
public class VtDpItemServiceImpl implements IVtDpItemService {

	@Autowired
	private VtDpItemDao vtDpItemDao;

	public int InsertEntity(VtDpItemEntity entity) throws Exception {
		try {
			return vtDpItemDao.InsertEntity(entity);
		} catch (Exception ex) {
			ex.printStackTrace();
			return -1;
		}
	}

	public List<VtDpItemEntity> GetVtDpItemListByWhere(String where) throws Exception {
		try {
			return vtDpItemDao.GetVtDpItemListByWhere(where);
		} catch (Exception ex) {
			ex.printStackTrace();
			return null;
		}
	}

	public int UpdateEntity(VtDpItemEntity entity) throws Exception {
		try {
			return vtDpItemDao.UpdateEntity(entity);
		} catch (Exception ex) {
			ex.printStackTrace();
			return -1;
		}
	}

	public int DeleteEntity(Long vtdpid) throws Exception {
		try {
			return vtDpItemDao.DeleteEntity(vtdpid);
		} catch (Exception ex) {
			ex.printStackTrace();
			return -1;
		}
	}
	public VtDpItemEntity GetVtDpItemListById(Long vtdpid)throws Exception{
		try {
			return vtDpItemDao.GetVtDpItemListById(vtdpid);
		} catch (Exception ex) {
			ex.printStackTrace();
			return null;
		}
	}
}
